package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.Company;
import com.ysd.entity.Leixing;
import com.ysd.entity.ZiXunNeiRong;
import com.ysd.util.DBManager;

public class LeixingDaoImpl {
	public  List<Leixing> getLeixing() {
		List<Leixing> list=new ArrayList<Leixing>();
		Connection lxb = DBManager.getConnection();
		Statement st = null;
		ResultSet rs = null;
		
		try {
			st = lxb.createStatement();
			rs = st.executeQuery("select * from leixingbiao");
			while (rs.next()) {
				String leiXingId = rs.getString("leiXingId");
				String yingShiLeiXing = rs.getString("yingShiLeiXing");
				Leixing leixing = new Leixing(leiXingId, yingShiLeiXing);
				list.add(leixing);
			}
			return list;
		} catch (SQLException e) {			
			e.printStackTrace();
			return null;			
		}
		finally {
			DBManager.closeAll(lxb, st, rs);
		}
	}
}
